#pragma once

class CAppNode
{
public:
	CAppNode(void);
	~CAppNode(void);
	void Clear() { m_iAppId = 0; ZeroMemory(m_uMouse, sizeof(m_uMouse)); ZeroMemory(m_uKeyboard, sizeof(m_uKeyboard)); }

	TCHAR *GetFullPath() { return m_strFullPath; }
	TCHAR *GetFileName() { return m_strFileName; }

	unsigned GetMouseTotal() { int sum = 0; for (int i=0; i<WM_MOUSELAST-WM_MOUSEFIRST; i++) sum += m_uMouse[i]; return sum; } 
	unsigned GetMouseClick() { return m_uMouse[2] + m_uMouse[5] + m_uMouse[8] + m_uMouse[0xC]; }
	unsigned GetMouseDoubleClick() { return m_uMouse[3] + m_uMouse[6] + m_uMouse[9] + m_uMouse[0xD]; }
	unsigned GetMouseLeftClick() { return m_uMouse[2]; }
	unsigned GetMouseLeftDoubleClick() { return m_uMouse[3]; }
	unsigned GetMouseRightClick() { return m_uMouse[5]; }
	unsigned GetMouseRightDoubleClick() { return m_uMouse[6]; }
	unsigned GetMouseMiddleClick() { return m_uMouse[8]; }
	unsigned GetMouseMiddleDoubleClick() { return m_uMouse[9]; }
	unsigned GetMouseXClick() { return m_uMouse[0xC]; }
	unsigned GetMouseXDoubleClick() { return m_uMouse[0xD]; }
	unsigned GetMouseOther() { return m_uMouse[0xA]; }

	unsigned GetKeyTotal() { int sum = 0; for (int i=0; i<2*4; i++) sum += m_uKeyboard[i]; return sum; } 
	unsigned GetKeyPrintable() { return m_uKeyboard[0] + m_uKeyboard[1]; }
	unsigned GetKeyAlphabet() { return m_uKeyboard[0]; }
	unsigned GetKeyDigit() { return m_uKeyboard[1]; }
	unsigned GetKeyExt() { return m_uKeyboard[2]; }
	unsigned GetKeyOther() { return m_uKeyboard[3]; }

	void operator += (const CAppNode &n);
private:
	friend class CAnalyzeDlg;

	int m_iAppId;

	// Path info
	TCHAR *m_strFullPath;
	TCHAR *m_strFileName;

	// Mouse
	unsigned m_uMouse[WM_MOUSELAST-WM_MOUSEFIRST];
	//unsigned m_uMLClk;
	//unsigned m_uMLDblClk;
	//unsigned m_uMRClk;
	//unsigned m_uMRDblClk;
	//unsigned m_uMMClk;
	//unsigned m_uMMDblClk;
	//unsigned m_uMXClk;
	//unsigned m_uMXDblClk;
	//unsigned m_uMOther;

	// Keyborad
	unsigned m_uKeyboard[2*4];	// first 4 for key up, last 4 for key down
	//unsigned m_uKAlphabet;
	//unsigned m_uKDigit;
	//unsigned m_uKExt;
	//unsigned m_uKOther;
};
